package com.haulmont.asu.web.ui.project_theme;

import com.haulmont.cuba.gui.WindowManager;
import com.haulmont.cuba.gui.components.AbstractLookup;
import com.haulmont.cuba.gui.components.Table;
import com.haulmont.cuba.gui.components.actions.CreateAction;
import com.haulmont.cuba.gui.components.actions.EditAction;

import javax.inject.Inject;
import java.util.Map;

/**
 * Author: Sergey42
 * Date: 09.11.13 6:47
 */
public class DiplomaThemeBrowser extends AbstractLookup {

    @Inject
    protected Table diplomaThemeTable;

    @Override
    public void init(Map<String, Object> params) {
        super.init(params);

        diplomaThemeTable.removeAction(getAction("diplomaThemeTable.create"));
        diplomaThemeTable.addAction(new CreateAction(diplomaThemeTable, WindowManager.OpenType.DIALOG));

        diplomaThemeTable.removeAction(getAction("diplomaThemeTable.edit"));
        diplomaThemeTable.addAction(new EditAction(diplomaThemeTable, WindowManager.OpenType.DIALOG));

    }
}
